#include<stdio.h>
int main()
{
	int m, i, j, cnt = 0, f = 0;
	scanf_s("%d", &m);//m=229
	for (i = m - 1; cnt < 10; i--)//227
	{
		for (j = 2; j < i; j++)//
		{
			if (i % j == 0)
			{
				f = 1; break;
			}
		}if (f == 0) {
				printf("%6d", i); cnt++;
			}
	}return 0;
}